﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WarsKeyChanger
{
    public class BloodConfig:WarsKeyConfig
    {
        public BloodConfig(string configFilePath)
            : base(configFilePath, "生命值显示设置")
        { 
        }

        public bool IsShowEnemyBlood
        {
            get
            {
                var hotKeyValue = ConfigFileInfo.GetSectionKeyValue(this.SectionName, "显示对方生命值");
                if (string.IsNullOrEmpty(hotKeyValue))
                {
                    ConfigFileInfo.SetSectionKeyValue(this.SectionName, "显示对方生命值", "1");
                    return true;
                }
                else 
                {
                    return hotKeyValue == "1";
                }
            }
            set
            {
                ConfigFileInfo.SetSectionKeyValue(this.SectionName, "显示对方生命值", value ? "1" : "0");
            }
        }

        public bool IsShowSeftBlood
        {
            get
            {
                var hotKeyValue = ConfigFileInfo.GetSectionKeyValue(this.SectionName, "显示已方生命值");
                if (string.IsNullOrEmpty(hotKeyValue))
                {
                    ConfigFileInfo.SetSectionKeyValue(this.SectionName, "显示已方生命值", "1");
                    return true;
                }
                else
                {
                    return hotKeyValue == "1";
                }
            }
            set
            {
                ConfigFileInfo.SetSectionKeyValue(this.SectionName, "显示已方生命值", value? "1":"0");
            }
        }
    }
}
